<?php

namespace app\admin\config\menu;
use app\common\model\AdminMenu as DataMode;
class Info
{
    public function Model()
    {
        return new DataMode();
    }

    public function ListModel()
    {
        $Model=new DataMode();
        $DB=$Model->alias('a');
        return $DB;
    }

    public function InfoMode()
    {
        $data=[
            'app_id'=>'5',
            'app_num'=>'admin',
            'app_name'=>'后台管理',
            'mode_id'=>'10',
            'mode_num'=>'menu',
            'mode_name'=>'菜单管理',
            'database'=>'admin_menu',
            'sub_database'=>[],        ];
        return $data;
    }

    public function InfoForm()
    {
        $data=[
            'power_field'=>[],
            'layout'=>[
                [
                    'field'=>'parent_id',
                    'title'=>'上级',
                    'value'=>'',
                    'tag'=>'tree',
                    'only'=>'2',
                    'required'=>'2',
                    'verify'=>'',
                    'options_num'=>'admin_menu',
                ],
                [
                    'field'=>'type',
                    'title'=>'类型',
                    'value'=>'1',
                    'tag'=>'radio',
                    'only'=>'2',
                    'required'=>'1',
                    'verify'=>'',
                    'options_num'=>'menu_type',
                ],
                [
                    'field'=>'title',
                    'title'=>'名称',
                    'value'=>'',
                    'tag'=>'input',
                    'only'=>'2',
                    'required'=>'1',
                    'verify'=>'',
                ],
                [
                    'field'=>'icon',
                    'title'=>'图标',
                    'value'=>'',
                    'tag'=>'icon',
                    'only'=>'2',
                    'required'=>'1',
                    'verify'=>'',
                ],
                [
                    'field'=>'app',
                    'title'=>'应用',
                    'value'=>'',
                    'tag'=>'input',
                    'only'=>'2',
                    'required'=>'2',
                    'verify'=>'',
                ],
                [
                    'field'=>'controller',
                    'title'=>'控制器',
                    'value'=>'',
                    'tag'=>'input',
                    'only'=>'2',
                    'required'=>'2',
                    'verify'=>'',
                ],
                [
                    'field'=>'action',
                    'title'=>'方法',
                    'value'=>'',
                    'tag'=>'input',
                    'only'=>'2',
                    'required'=>'2',
                    'verify'=>'',
                ],
                [
                    'field'=>'query',
                    'title'=>'参数',
                    'value'=>'',
                    'tag'=>'input',
                    'only'=>'2',
                    'required'=>'2',
                    'verify'=>'',
                ],
                [
                    'field'=>'href',
                    'title'=>'外部链接',
                    'value'=>'',
                    'tag'=>'input',
                    'only'=>'2',
                    'required'=>'2',
                    'verify'=>'',
                ],
                [
                    'field'=>'sort',
                    'title'=>'排序',
                    'value'=>'1',
                    'tag'=>'number',
                    'only'=>'2',
                    'required'=>'1',
                    'verify'=>'isinteger',
                ],
            ],
        ];
        return $data;
    }

    public function InfoLists()
    {
        $data=[
            'lists'=>[
                [
                    'name'=>'全部',
                    'num'=>'m_1713364429',
                    'page_num'=>'30',
                    'order_raw'=>'sort asc,id desc',
                    'power_field'=>[],
                    'power_role'=>'',
                    'power_department'=>'',
                    'set_where'=>'',
                    'table_cols'=>[
                [
                    'field'=>'title',
                    'title'=>'名称',
                    'update'=>'',
                    'options'=>'',
                    'search'=>'',
                    'total'=>'2',
                ],
                [
                    'field'=>'type',
                    'title'=>'类型',
                    'update'=>'',
                    'options'=>'menu_type',
                    'search'=>'',
                    'total'=>'2',
                ],
                [
                    'field'=>'parent_id',
                    'title'=>'上级',
                    'update'=>'',
                    'options'=>'',
                    'search'=>'',
                    'total'=>'2',
                ],
                [
                    'field'=>'sort',
                    'title'=>'排序',
                    'update'=>'input',
                    'options'=>'',
                    'search'=>'',
                    'total'=>'2',
                ],
                [
                    'field'=>'app',
                    'title'=>'应用',
                    'update'=>'',
                    'options'=>'',
                    'search'=>'',
                    'total'=>'2',
                ],
                [
                    'field'=>'controller',
                    'title'=>'控制器',
                    'update'=>'',
                    'options'=>'',
                    'search'=>'',
                    'total'=>'2',
                ],
                [
                    'field'=>'action',
                    'title'=>'方法',
                    'update'=>'',
                    'options'=>'',
                    'search'=>'',
                    'total'=>'2',
                ],
                [
                    'field'=>'query',
                    'title'=>'参数',
                    'update'=>'',
                    'options'=>'',
                    'search'=>'',
                    'total'=>'2',
                ],
                [
                    'field'=>'href',
                    'title'=>'外部链接',
                    'update'=>'',
                    'options'=>'',
                    'search'=>'',
                    'total'=>'2',
                ],
            ],

                ],
            ],
        ];
        return !empty($data['lists']) ? $data['lists'] : [];
    }

}